<template>
  <div class="profile-container">
    <!-- 星星背景 -->
    <div class="stars"></div>
    <!-- 悬停背景图片 -->
    <div 
      v-if="hoveredPerson !== -1" 
      class="hovered-background"
      :style="{ backgroundImage: `url('/images/OIP-${hoveredPerson + 1}.webp')` }"
    ></div>
    
    <h1 class="page-title">AVE MUJICA</h1>
    
    <!-- 人物卡片区域 -->
    <div class="people-grid">
      <div 
        v-for="(person, index) in people" 
        :key="index" 
        class="person-card"
        @mouseenter="hoveredPerson = index"
        @mouseleave="hoveredPerson = -1"
      >
        <div class="image-container">
          <img 
            :src="`/images/person${index + 1}.jpg`" 
            alt="Person ${index + 1}" 
            class="person-image"
          >
        </div>
      </div>
    </div>
    
    <!-- 固定的空白区域，始终占据空间 -->
    <div class="fixed-person-info">
      <!-- 使用绝对定位确保内容不影响布局 -->
      <div class="person-info-content" v-if="hoveredPerson !== -1">
        <h3>{{ people[hoveredPerson].name }}</h3>
        <p>{{ people[hoveredPerson].bio }}</p>
      </div>
    </div>
    
    <!-- 论坛区域 - 改为三栏布局 -->
    <div class="forum-section">
      <h2 class="forum-title">讨论论坛</h2>
      
      <!-- 搜索框 -->
      <div class="search-container">
        <div class="search-box">
          <input 
            type="text" 
            v-model="searchQuery"
            placeholder="搜索论坛内容..." 
            class="search-input"
          >
          <button class="search-btn">搜索</button>
        </div>
      </div>
      
      <div class="forum-layout">
        <!-- 最左侧：长帖子栏 -->
        <div class="forum-long-posts-column">
          <h3 class="long-posts-title">深度讨论</h3>
          <div class="long-posts-list">
            <div class="long-post" v-for="(post, index) in longPosts" :key="index" @click="togglePost(index)">
              <h4 class="long-post-title">{{ post.title }}</h4>
              <div class="long-post-content">
                <p v-if="expandedPost !== index">{{ truncateText(post.content) }}</p>
                <div v-else>
                  <p>{{ getPostContent(post) }}</p>
                  <!-- VIP解锁提示 -->
                  <div v-if="!isVIP && post.content.split('。').filter(s => s.trim() !== '').length > 4" class="vip-lock">
                    <div class="vip-lock-content">
                      <span class="vip-badge">💎 VIP内容</span>
                      <p>解锁更多精彩内容，了解详细信息！</p>
                      <button class="unlock-btn" @click.stop="toggleVIP">立即解锁</button>
                    </div>
                  </div>
                </div>
              </div>
              <div class="long-post-toggle">
                {{ expandedPost === index ? '收起' : '展开' }} ▼
              </div>
            </div>
          </div>
        </div>
        
        <!-- 中间栏：用户评论 -->
        <div class="forum-left-column">
          <div class="forum-posts">
            <div class="forum-post" v-for="(post, index) in forumPosts" :key="index">
              <div class="post-header">
                <span class="post-author">{{ post.author }}</span>
                <span class="post-time">{{ post.time }}</span>
              </div>
              <div class="post-content">{{ post.content }}</div>
              <div class="post-actions">
                <button class="like-btn">👍 {{ post.likes }}</button>
                <button class="comment-btn">💬 {{ post.comments }}</button>
              </div>
            </div>
          </div>
          
          <!-- 发布新帖 -->
          <div class="new-post">
            <textarea placeholder="分享你的想法..." class="post-input"></textarea>
            <button class="submit-btn">发布</button>
          </div>
        </div>
        
        <!-- 右侧栏：热门搜索和登录/注册 -->
        <div class="forum-right-column">
          <!-- 热门搜索 -->
          <div class="hot-searches">
            <h3 class="hot-searches-title">热门搜索</h3>
            <div class="hot-search-list">
              <div class="hot-search-item" v-for="(search, index) in hotSearches" :key="index">
                <span class="search-rank">{{ index + 1 }}</span>
                <span class="search-keyword">{{ search }}</span>
              </div>
            </div>
          </div>
          
          <!-- 登录/注册按钮 -->
          <div class="auth-buttons">
            <button class="login-btn">登录</button>
            <button class="register-btn">注册</button>
            <!-- VIP切换按钮（仅用于演示） -->
            <button class="vip-demo-btn" @click="toggleVIP">
              {{ isVIP ? '退出VIP模式' : '进入VIP模式' }}
            </button>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue';

// 存储当前悬停的人物索引
const hoveredPerson = ref(-1);

// 存储当前展开的长帖子索引
const expandedPost = ref(-1);

// VIP状态（模拟）
const isVIP = ref(false);

// 搜索查询
const searchQuery = ref('');

// 人物数据（姓名和经历）
const people = [
  {
    name: '人物1',
    bio: '这里是人物1的详细介绍，包括个人经历、成就等信息。'
  },
  {
    name: '人物2',
    bio: '这里是人物2的详细介绍，包括个人经历、成就等信息。'
  },
  {
    name: '人物3',
    bio: '这里是人物3的详细介绍，包括个人经历、成就等信息。'
  },
  {
    name: '人物4',
    bio: '这里是人物4的详细介绍，包括个人经历、成就等信息。'
  },
  {
    name: '人物5',
    bio: '这里是人物5的详细介绍，包括个人经历、成就等信息。'
  }
];

// 论坛帖子数据
const forumPosts = [
  {
    author: '用户1',
    time: '2小时前',
    content: '我觉得这些人物都很有特色，你们最喜欢哪一位呢？',
    likes: 15,
    comments: 8
  },
  {
    author: '用户2',
    time: '5小时前',
    content: '期待更多关于这些人物的详细信息分享。',
    likes: 10,
    comments: 3
  },
  {
    author: '用户3',
    time: '昨天',
    content: '这个页面设计得真不错，视觉效果很好！',
    likes: 25,
    comments: 12
  }
];

// 热门搜索数据
const hotSearches = [
  'AVE MUJICA',
  '背景设计',
  '论坛讨论',
  '人物成就',
  '页面效果',
  '互动交流',
  '设计灵感'
];

// 长帖子数据
const longPosts = [
  {
    title: '深入解析人物1的传奇经历',
    content: '人物1出生于一个普通家庭，但凭借着过人的天赋和不懈的努力，最终成为了行业内的佼佼者。他的故事激励了无数年轻人追逐自己的梦想。在他的职业生涯中，他克服了许多困难和挑战，始终保持着对事业的热爱和追求卓越的精神。他的成功之路充满了曲折，但每一次挫折都成为了他前进的动力。如今，他不仅在事业上取得了巨大成功，还积极投身于公益事业，用自己的影响力去帮助更多需要帮助的人。'
  },
  {
    title: '人物2的创新思维与实践',
    content: '人物2以其独特的创新思维和大胆的实践精神而闻名。他总是能够看到别人看不到的机会，并且勇于尝试新的方法和思路。他的许多创新理念和实践案例已经成为行业内的标杆。在面对传统观念的束缚时，他从不退缩，而是用实际成果证明自己的价值。他的成功告诉我们，创新不仅仅是一种理念，更是一种行动和坚持。正是这种精神，让他在竞争激烈的环境中脱颖而出，成为了行业的领军人物。'
  },
  {
    title: '人物3的艺术人生与创作历程',
    content: '人物3的艺术人生充满了传奇色彩。从小就展现出非凡的艺术天赋，经过多年的刻苦学习和实践，终于形成了自己独特的艺术风格。他的作品不仅在国内受到广泛赞誉，还多次在国际展览中获得重要奖项。他的创作灵感来源于生活，却又超越了生活，给人以深刻的思考和美的享受。在他的艺术道路上，他始终坚持自己的艺术理想，不为世俗所左右，这种精神值得我们每一个人学习。他的艺术成就不仅体现在作品上，更体现在对年轻艺术家的培养和扶持上。'
  }
];

// 切换长帖子展开/收起状态
const togglePost = (index) => {
  if (expandedPost.value === index) {
    expandedPost.value = -1;
  } else {
    expandedPost.value = index;
  }
};

// 截断文本，只显示前两行并用省略号表示
const truncateText = (text) => {
  // 假设每行约30个汉字
  const maxLength = 60;
  if (text.length <= maxLength) {
    return text;
  }
  return text.substring(0, maxLength) + '...';
};

// 检查VIP并处理帖子内容显示
const getPostContent = (post) => {
  // 将帖子内容按句子分割，假设以句号为分隔符
  const sentences = post.content.split('。').filter(s => s.trim() !== '');
  
  // 如果用户是VIP或内容少于5行，显示全部内容
  if (isVIP.value || sentences.length <= 4) {
    return sentences.join('。') + '。';
  }
  
  // 否则只显示前4行
  return sentences.slice(0, 4).join('。') + '。';
};

// 切换VIP状态（用于演示）
const toggleVIP = () => {
  isVIP.value = !isVIP.value;
};
</script>

<style>
/* 全局样式重置 - 使用非scoped样式确保应用到整个页面 */
html, body {
  margin: 0 !important;
  padding: 0 !important;
  background-color: #0a0a0f !important;
  color: white;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  margin: 0 !important;
  padding: 0 !important;
  background-color: transparent;
}

/* 移除默认的body滚动条边距 */
body {
  margin: 0 !important;
  overflow-x: hidden;
}
</style>

<style scoped>
/* 组件内部样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 确保人物介绍页面容器样式 */
.profile-container {
  min-height: 100vh;
  width: 100%;
  background: linear-gradient(180deg, #7e22ce 0%, #dc2626 100%);
  padding: 2rem;
  color: white;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 悬停背景图片样式 */
.hovered-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.15;
  z-index: 0;
  animation: fadeInBg 0.5s ease-out;
  filter: blur(5px);
}

@keyframes fadeInBg {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.15;
  }
}

/* 星星背景效果 */
.stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: #0a0a0f;
}

/* 小星星层 - 更密集的星星 */
.stars::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 10px 15px, white, transparent),
    radial-gradient(2px 2px at 20px 35px, white, transparent),
    radial-gradient(1px 1px at 45px 20px, white, transparent),
    radial-gradient(1px 1px at 65px 40px, white, transparent),
    radial-gradient(2px 2px at 80px 60px, white, transparent),
    radial-gradient(2px 2px at 95px 25px, white, transparent),
    radial-gradient(1px 1px at 115px 45px, white, transparent),
    radial-gradient(2px 2px at 130px 70px, white, transparent),
    radial-gradient(1px 1px at 150px 85px, white, transparent),
    radial-gradient(2px 2px at 170px 55px, white, transparent),
    radial-gradient(1px 1px at 190px 75px, white, transparent),
    radial-gradient(2px 2px at 210px 90px, white, transparent),
    radial-gradient(1px 1px at 230px 105px, white, transparent),
    radial-gradient(2px 2px at 250px 65px, white, transparent),
    radial-gradient(1px 1px at 270px 85px, white, transparent),
    radial-gradient(2px 2px at 290px 100px, white, transparent),
    radial-gradient(1px 1px at 310px 45px, white, transparent),
    radial-gradient(2px 2px at 330px 65px, white, transparent),
    radial-gradient(1px 1px at 350px 80px, white, transparent),
    radial-gradient(2px 2px at 370px 100px, white, transparent),
    radial-gradient(1px 1px at 390px 30px, white, transparent),
    radial-gradient(2px 2px at 410px 50px, white, transparent),
    radial-gradient(1px 1px at 430px 70px, white, transparent),
    radial-gradient(2px 2px at 450px 90px, white, transparent),
    radial-gradient(1px 1px at 470px 110px, white, transparent),
    radial-gradient(2px 2px at 490px 65px, white, transparent),
    radial-gradient(1px 1px at 510px 85px, white, transparent),
    radial-gradient(2px 2px at 530px 100px, white, transparent),
    radial-gradient(1px 1px at 550px 45px, white, transparent),
    radial-gradient(2px 2px at 570px 65px, white, transparent),
    radial-gradient(1px 1px at 590px 80px, white, transparent),
    radial-gradient(2px 2px at 610px 100px, white, transparent);
  background-repeat: repeat;
  background-size: 200px 200px;
  opacity: 0.6;
  animation: twinkle 10s infinite;
}

/* 中等大小星星层 - 更密集的星星 */
.stars::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(3px 3px at 30px 50px, #ffffff, transparent),
    radial-gradient(3px 3px at 60px 100px, #ffffff, transparent),
    radial-gradient(3px 3px at 120px 75px, #ffffff, transparent),
    radial-gradient(3px 3px at 180px 125px, #ffffff, transparent),
    radial-gradient(3px 3px at 240px 90px, #ffffff, transparent),
    radial-gradient(3px 3px at 300px 110px, #ffffff, transparent),
    radial-gradient(3px 3px at 360px 50px, #ffffff, transparent),
    radial-gradient(3px 3px at 420px 75px, #ffffff, transparent),
    radial-gradient(3px 3px at 480px 125px, #ffffff, transparent),
    radial-gradient(3px 3px at 540px 90px, #ffffff, transparent),
    radial-gradient(3px 3px at 600px 110px, #ffffff, transparent),
    radial-gradient(3px 3px at 660px 50px, #ffffff, transparent),
    radial-gradient(3px 3px at 720px 75px, #ffffff, transparent),
    radial-gradient(3px 3px at 780px 125px, #ffffff, transparent),
    radial-gradient(3px 3px at 840px 90px, #ffffff, transparent),
    radial-gradient(3px 3px at 900px 110px, #ffffff, transparent);
  background-repeat: repeat;
  background-size: 300px 300px;
  opacity: 0.4;
  animation: twinkle 15s infinite alternate;
}

/* 星星闪烁动画 */
@keyframes twinkle {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.3; }
}

.page-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: #f0f0f0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 1;
}

/* 人物卡片网格 */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  position: relative;
  z-index: 1;
  justify-items: center;
}

.person-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.person-card:hover {
  transform: translateY(-10px);
}

/* 图片容器和悬停效果 */
.image-container {
  overflow: hidden;
  border-radius: 50%;
  width: 180px;
  height: 180px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.person-card:hover .image-container {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.person-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.person-card:hover .person-image {
  transform: scale(1.2);
}

/* 固定的人物介绍区域 */
.fixed-person-info {
  margin: 2rem auto 4rem;
  padding: 2rem;
  background: transparent; /* 完全透明背景 */
  position: relative;
  z-index: 1;
  max-width: 800px;
  width: 100%;
  height: 120px; /* 使用固定高度而不是最小高度 */
  overflow: visible; /* 允许内容超出容器 */
}

.person-info-content {
  text-align: center;
  width: 100%;
  animation: fadeInBg 0.5s ease-out;
  position: absolute; /* 使用绝对定位，不影响父容器高度 */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}





.person-info-content h3 {
  margin: 0 0 1rem 0;
  font-size: 1.8rem;
  color: #f0f0f0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.person-info-content p {
  margin: 0;
  color: #d0d0d0;
  font-size: 1.1rem;
  line-height: 1.6;
}

/* 论坛区域 - 调整宽度，只保留一点空隙 */
.forum-section {
  background: #1a1a2e;
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: forumGlow 5s ease-in-out infinite alternate;
  position: relative;
  z-index: 1;
  max-width: calc(100% - 4rem); /* 左右各留2rem的空隙 */
  margin: 0 auto; /* 居中显示 */
}

@keyframes forumGlow {
  from {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  }
  to {
    box-shadow: 0 8px 32px rgba(126, 45, 217, 0.5);
  }
}

.forum-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #f0f0f0;
}

/* 搜索框样式 */
.search-container {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.search-box {
  display: flex;
  width: 100%;
  max-width: 600px;
  background: #2d2d44;
  border-radius: 25px;
  overflow: hidden;
  border: 1px solid #4a4a6a;
  transition: all 0.3s ease;
}

.search-box:focus-within {
  background: #3d3d55;
  border-color: #a78bfa;
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.5);
}

.search-input {
  flex: 1;
  padding: 0.8rem 1.5rem;
  border: none;
  background: transparent;
  color: #f0f0f0;
  font-size: 1rem;
  outline: none;
}

.search-input::placeholder {
  color: rgba(240, 240, 240, 0.6);
}

.search-btn {
  padding: 0 1.5rem;
  background: linear-gradient(45deg, #7e22ce, #a78bfa);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-btn:hover {
  background: linear-gradient(45deg, #6b21a8, #8b5cf6);
  transform: translateY(-2px);
}

/* 论坛三栏布局 */
.forum-layout {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* 最左侧：长帖子栏 */
.forum-long-posts-column {
  width: 100%;
}

.long-posts-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: #f0f0f0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.5rem;
}

.long-posts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.long-post {
  background: #2d2d44;
  padding: 1.5rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.long-post:hover {
  background: #3d3d55;
  transform: translateY(-5px);
}

.long-post-title {
  font-size: 1rem;
  font-weight: bold;
  color: #a78bfa;
  margin-bottom: 0.8rem;
  line-height: 1.4;
}

.long-post-content {
  margin-bottom: 0.8rem;
  line-height: 1.6;
  color: #e5e7eb;
}

.long-post-toggle {
  text-align: right;
  color: #9ca3af;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.long-post:hover .long-post-toggle {
  color: #a78bfa;
}

/* VIP锁定区域样式 */
.vip-lock {
  margin-top: 1rem;
  padding: 1.5rem;
  background: #2d2d44;
  border: 1px solid rgba(255, 215, 0, 0.5);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.vip-lock::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(255,215,0,0) 0%, rgba(255,215,0,1) 50%, rgba(255,215,0,0) 100%);
}

.vip-lock-content {
  text-align: center;
}

.vip-badge {
  display: inline-block;
  padding: 0.3rem 1rem;
  background: rgba(255, 215, 0, 0.2);
  border-radius: 20px;
  font-weight: bold;
  color: #ffd700;
  margin-bottom: 0.8rem;
}

.vip-lock-content p {
  color: #d0d0d0;
  margin-bottom: 1rem;
}

.unlock-btn {
  background: linear-gradient(135deg, #ffd700 0%, #ffcc00 100%);
  border: none;
  color: #1a1a2e;
  padding: 0.8rem 2rem;
  border-radius: 25px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.unlock-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

/* VIP演示按钮样式 */
.vip-demo-btn {
  padding: 1rem;
  border: 2px solid rgba(255, 215, 0, 0.5);
  background: rgba(255, 215, 0, 0.1);
  color: #ffd700;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.vip-demo-btn:hover {
  background: rgba(255, 215, 0, 0.2);
  border-color: #ffd700;
  transform: translateY(-3px);
}

/* 左栏 - 用户评论 */
.forum-left-column {
  width: 100%;
}

.forum-posts {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.forum-post {
  background: #2d2d44;
  padding: 1.5rem;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.forum-post:hover {
  background: #3d3d55;
  transform: translateY(-5px);
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.post-author {
  font-weight: bold;
  color: #a78bfa;
}

.post-time {
  color: #9ca3af;
  font-size: 0.8rem;
}

.post-content {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: #e5e7eb;
}

.post-actions {
  display: flex;
  gap: 1rem;
}

.like-btn, .comment-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.like-btn:hover, .comment-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

/* 新帖发布区域 */
.new-post {
  background: #2d2d44;
  border-radius: 10px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-input {
  background: #3d3d55;
  border: 1px solid #4a4a6a;
  color: white;
  padding: 1rem;
  border-radius: 10px;
  resize: none;
  font-family: inherit;
  transition: all 0.3s ease;
}

.post-input:focus {
  outline: none;
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}

.post-input::placeholder {
  color: #9ca3af;
}

.submit-btn {
  background: #a78bfa;
  border: none;
  color: white;
  padding: 1rem 2rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  align-self: flex-end;
}

.submit-btn:hover {
  background: #8b5cf6;
  transform: scale(1.05);
}

/* 右栏 - 热门搜索和登录/注册 */
.forum-right-column {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* 热门搜索 */
.hot-searches {
  background: #2d2d44;
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 2rem;
}

.hot-searches-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: #f0f0f0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.5rem;
}

.hot-search-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.hot-search-item {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  border-radius: 5px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.hot-search-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.search-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 0.8rem;
  background: #a78bfa;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: bold;
}

/* 前三名搜索项特殊样式 */
.hot-search-list .hot-search-item:nth-child(1) .search-rank {
  background: #ff4d4f;
}

.hot-search-list .hot-search-item:nth-child(2) .search-rank {
  background: #fa8c16;
}

.hot-search-list .hot-search-item:nth-child(3) .search-rank {
  background: #1890ff;
}

.search-keyword {
  color: #e5e7eb;
}

/* 登录/注册按钮 */
.auth-buttons {
  background: #2d2d44;
  border-radius: 10px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-btn, .register-btn {
  padding: 1rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.login-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

.register-btn {
  background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
  color: white;
}

.register-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(167, 139, 250, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .people-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .page-title {
    font-size: 2rem;
  }
  
  .forum-title {
    font-size: 1.5rem;
  }
  
  .image-container {
    width: 150px;
    height: 150px;
  }
  
  .person-info h3 {
    font-size: 1.5rem;
  }
  
  .person-info p {
    font-size: 1rem;
  }
  
  /* 论坛三栏在小屏幕上改为两栏 */
  .forum-layout {
    grid-template-columns: 1fr 1fr;
  }
  
  /* 热门搜索栏优先显示 */
  .forum-right-column {
    order: -1;
  }
  
  /* 长帖子栏在两栏布局中隐藏 */
  .forum-long-posts-column {
    display: none;
  }
  
  /* 小屏幕上进一步减小空隙 */
  .forum-section {
    max-width: calc(100% - 2rem); /* 左右各留1rem的空隙 */
  }
}

@media (max-width: 480px) {
  .people-grid {
    grid-template-columns: 1fr;
  }
  
  .profile-container {
    padding: 1rem;
  }
  
  .unified-info-container {
    padding: 1rem;
  }
  
  /* 论坛在最小屏幕上完全改为单栏 */
  .forum-layout {
    grid-template-columns: 1fr;
  }
  
  /* 重新显示长帖子栏并调整顺序 */
  .forum-long-posts-column {
    display: block;
  }
  
  .forum-right-column {
    order: 1;
  }
  
  .forum-left-column {
    order: 2;
  }
  
  .forum-long-posts-column {
    order: 3;
  }
  
  .forum-section {
    padding: 1.5rem;
    max-width: calc(100% - 1rem); /* 左右各留0.5rem的空隙 */
  }
}
</style>